Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 4 - Printing Messages / Printing Messages Reference
Printing Messages / Spooling Messages


GXSpoolResource

QuickDraw GX sends the GXSpoolResource message when a resource is about to be added to the spool file. You can override the GXSpoolResource message to add your own resource to the spool file. Your override of the GXSpoolResource message must match the following formal declaration:

OSErr MySpoolResource (gxSpoolFile aSpoolFile, Handle aResource, 
                        ResType aType, short id);
aSpoolFile
The spool file to which you are adding resources.
aResource
A handle to the resource that you want added to the spool file.
aType
The resource type of the resource that you are adding.
id
The resource ID of the resource that you are adding.
function result
An error code. The value noErr indicates that the operation was successful.
DESCRIPTION
QuickDraw GX sends the GXSpoolResource message after a message handler has issued a GXSpoolResource message to write a resource to the spool file.

You can override this message if you need to change the data in a resource that is being added to the spool file. For example, if you are encrypting the data in a spool file, you might want to override this message and encrypt the resource data before it is written
to the file.

The default implementation of GXSpoolResource expects the aResource handle to
be a normal memory handle, not a resource. After this message executes, the handle has become a resource handle that the caller cannot use. This behavior is the same as for the AddResource function, which is described in the chapter "Resource Manager" in
Inside Macintosh: More Macintosh Toolbox.

SPECIAL CONSIDERATIONS
You can send the GXSpoolResource message yourself if you have a resource that you want to store in the spool file.

If you are providing your own spooling, you need to totally override the GXSpoolResource message and all of the other spooling and despooling messages.

If you are not providing your own spooling, you must forward the GXSpoolResource message to allow the default implementation to write the data into the spool file.

RESULT CODES
gxSegmentLoadFailedErrA required code segment could not be found,
or there was not enough memory to load it.
gxPrUserAbortErrThe user has canceled printing.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help